/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package session04;

import java.util.Comparator;

/**
 *
 * @author macbookpro
 */
public class StudentSortByName implements Comparator {

    @Override
    public int compare(Object t, Object t1) {
        if (!(t instanceof Student) || !(t1 instanceof Student)) {
            throw new UnsupportedOperationException("Not supported yet.");
        }
        Student s = (Student) t;
        Student s1 = (Student) t1;
        return s.getName().compareTo(s1.getName());
    }
}
